home *** CD-ROM | disk | FTP | other *** search
/ Risc World 7 / Risc World 7.iso / Software / Issue2 / SDL.ARC / !gcc / include / libscl / h / setjmp < prev    next >
Encoding:
Text File  |  2004-09-05  |  1.1 KB  |  43 lines

  1. /* setjmp.h
  2.  
  3.    For use with the GNU compilers and the SharedCLibrary.
  4.    (c) Copyright 1997, 2003, Nick Burrett.  */
  5.  
  6. #ifndef __SETJMP_H
  7. #define __SETJMP_H
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. /* Objects of type jmp_buf hold the state information to be
  14.    restored by a non-local exit.  */
  15. #ifdef __JMP_BUF_SIZE
  16. typedef int jmp_buf[__JMP_BUF_SIZE];
  17. #else
  18. typedef int jmp_buf[22];
  19. #endif
  20.  
  21. /* setjmp stores information about the execution state of the
  22.    program in 'state' and returns zero.  If longjmp is later
  23.    used to perform a non-local exit to this 'state', setjmp
  24.    returns a nonzero value.  */
  25. extern int setjmp (jmp_buf __state);
  26.  
  27. #ifdef __STDC__
  28. /* ANSI states that setjmp must be a macro.  */
  29. #define setjmp(jmp_buf) (setjmp(jmp_buf))
  30. #endif
  31.  
  32. /* Restore the current execution to the state saved in 'state'.
  33.    Returning from setjmp by means of longjmp returns 'value'
  34.    argument that was passed to longjmp rather than 0.  If 'value'
  35.    is 0, setjmp returns 1.  */
  36. extern void longjmp (jmp_buf __state, int __value) __attribute__ ((__noreturn__));
  37.  
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41.  
  42. #endif
  43.